/**
 * 功能描述
 */

define(function (require, exports, module) {
	var roomTypesPriceCalendarComp = require("../component/roomTypesPriceCalendarComp");
    module.exports = {
    	refreshCalendar:function(widget){
    		var subnav = widget.get("subnav");
    		var selectDate = widget.get("monthRange").getValue();
    		var pkServicePoint = subnav.getValue("servicepoint");
        	var pkOrgBuilding = subnav.getValue("buiding");
        	var pkRoomType = subnav.getValue("roomtypes");
        	
        	if(selectDate && pkServicePoint && pkOrgBuilding && pkRoomType){
        		roomTypesPriceCalendarComp.setCalendarData(widget);
        	}else{
        		roomTypesPriceCalendarComp.clearCalendar(widget);
        		roomTypesPriceCalendarComp.initComponent(null,widget);
        	}
    	}
    };
});
